<template>
  <div class="modelParams-container">
    <div class="item" v-for="(item, index) in modelParams">
      <span class="name">{{ item.name }}：</span>
      <div class="item-content">
        <div class="inupt-area" v-for="(tig, tindex) in item.val" :key="tindex">
          <span>{{ tig.name }}</span>
          <el-input v-model="tig.val" @blur="handleBlur"></el-input>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "modelParams",
  data() {
    return {
      modelParams: []
    };
  },
  methods: {
    setmodelParams(arr) {
      this.modelParams = arr
    },
    handleBlur() {
      console.log(this.modelParams)
      this.$emit("updatemodelParams", this.modelParams)
    }
  },
};
</script>

<style lang="scss" scoped>
.modelParams-container {
  width: auto;
  height: 100%;
  display: flex;

  .item {
    height: 100%;
    display: flex;
    align-items: center;

    .name {
      font-size: 14px;
      margin-left: 4px;
    }

    .item-content {
      height: 100%;
      display: flex;
      flex-direction: column;

      // justify-content: center;
      // align-items: center;
      .inupt-area {
        display: flex;
        margin-top: 4px;

        span {
          font-size: 12px;
        }

        .el-input {
          width: 100px;

          ::v-deep .el-input__inner {
            height: 20px;
          }
        }
      }
    }
  }
}
</style>
